package com.itheima.sh.config.controller;

import com.itheima.sh.config.mapper.UserMapper;
import com.itheima.sh.config.pojo.User;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @Description:
 * @Version: V1.0
 */
@RestController
@RequestMapping("user")
@Slf4j
public class UserController {

    private static Logger LOGGER = LoggerFactory.getLogger(UserController.class);

    @Autowired
    UserMapper userMapper;


    @GetMapping
    public List<User> findAll() {


        LOGGER.error("");

        log.info("SpringBoot Test");
        // 异常
        log.error("error");
        return userMapper.findAll();
    }
}
